<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
 * SugarCRM Community Edition is a customer relationship management program developed by
 * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Affero General Public License version 3 as published by the
 * Free Software Foundation with the addition of the following permission added
 * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
 * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
 * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License along with
 * this program; if not, see http://www.gnu.org/licenses or write to the Free
 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * 
 * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
 * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * SugarCRM" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by SugarCRM".
 ********************************************************************************/
require_once 'include/phpExcel/PHPExcel.php';   
   
/** PHPExcel_Writer_Excel2007 */   
require_once 'include/phpExcel/PHPExcel/Writer/Excel2007.php';


require_once('include/export_utils.php');
global $sugar_config;
global $locale;
global $current_user;
global $app_list_strings;

$the_module = clean_string($_REQUEST['module']);

if($sugar_config['disable_export'] 	|| (!empty($sugar_config['admin_export_only']) && !(is_admin($current_user) || (ACLController::moduleSupportsACL($the_module)  && ACLAction::getUserAccessLevel($current_user->id,$the_module, 'access') == ACL_ALLOW_ENABLED &&
    (ACLAction::getUserAccessLevel($current_user->id, $the_module, 'admin') == ACL_ALLOW_ADMIN ||
     ACLAction::getUserAccessLevel($current_user->id, $the_module, 'admin') == ACL_ALLOW_ADMIN_DEV))))){
	die($GLOBALS['app_strings']['ERR_EXPORT_DISABLED']);
}
//check to see if this is a request for a sample or for a regular export
if(!empty($_REQUEST['sample'])){

    //call special method that will create dummy data for bean as well as insert standard help message.
    $content = exportSample(clean_string($_REQUEST['module']));

}else if(!empty($_REQUEST['uid'])){
	$content = export(clean_string($_REQUEST['module']), $_REQUEST['uid'], isset($_REQUEST['members']) ? $_REQUEST['members'] : false);
}else{
	$content = export(clean_string($_REQUEST['module']));
}

//var_dump($content);
//strip away any blank spaces
if($the_module=='WarrantCompany' or $the_module=='warrantcompany' or $the_module=='SciLoanCompany' or $the_module=='sciloancompany' or $the_module=='AgriLoanCompany' or $the_module=='agriloancompany' or $the_module=='AdministerCompany' or $the_module=='administercompany') {
	$tmp=array();
	$tmp[0]=array();
	$waIndex=0;$slIndex=0;$adIndex=0;$alIndex=0;
	$index=0;
	//var_dump(count($content));
	while($index<count($content)) {

		if($content[$index]['company_properties']=='6') {
		//var_dump("im here0");
			$tmp[0][$waIndex] = $content[$index];
			$index++;
			$waIndex++;
		}
		else if($content[$index]['company_properties']=='7') {
		//var_dump("im here1");
			$tmp[1][$slIndex] = $content[$index];
			$index++;
			$slIndex++;
		}
		else if($content[$index]['company_properties']=='8') {
		//var_dump("im here2");
			$tmp[2][$adIndex] = $content[$index];
			$index++;
			$adIndex++;
		}
		else if($content[$index]['company_properties']=='9') {
		//var_dump("im here3");
			$tmp[3][$alIndex] = $content[$index];
			$index++;
			$alIndex++;
		}
		else {
		//var_dump("im here4");
			$index++;
		}
	}
		
		$objPHPExcel = new PHPExcel();
		$objPHPExcel->getProperties()->setCreator("")
		->setLastModifiedBy("")
		->setTitle("")
		->setSubject("")
		->setDescription("")
		->setKeywords("")
		->setCategory("");
				
	//$objPHPExcel->getActiveSheet()->mergeCells('a1:f1');
	//$objPHPExcel->getActiveSheet()->mergeCells('a2:a3');
	//$objPHPExcel->getActiveSheet()->mergeCells('b2:b3');
	//$objPHPExcel->getActiveSheet()->mergeCells('c2:c3');
	//$objPHPExcel->getActiveSheet()->mergeCells('d2:d3');
	//$objPHPExcel->getActiveSheet()->mergeCells('e2:e3');
	//$objPHPExcel->getActiveSheet()->mergeCells('f2:f3');
	$sheetIndex=0;
	while($sheetIndex<4) {
		
		if($sheetIndex==0) {
			$rows=$tmp[0];
			$objPHPExcel->getActiveSheet()->mergeCells('a1:e1');
			$objPHPExcel->getActiveSheet()->setTitle('担保公司');
			$objPHPExcel->setActiveSheetIndex(0)
				->setCellValue('a1', '宿迁市同创信用担保有限公司')
				->setCellValue('a2', '序号')
				->setCellValue('b2', '单位名称')
				->setCellValue('c2', '担保金额')
				->setCellValue('d2', '办理日期')
				->setCellValue('e2', '反担保措施');
	
			$objPHPExcel->getActiveSheet()->getStyle('a1:e1')->getFont()->setSize(12);
			$objPHPExcel->getActiveSheet()->getStyle('a1:e1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a1:e1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			//$objPHPExcel->getActiveSheet()->getStyle('a1:e1')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('a1:e1')->getFont()->setName('宋体');
		
		
			$objPHPExcel->getActiveSheet()->getStyle('a2:e2')->getAlignment()->setWrapText(true);
			$objPHPExcel->getActiveSheet()->getStyle('a2:e2')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
			
			$objPHPExcel->getActiveSheet()->getStyle('a2:e2')->getFill()->getStartColor()->setARGB('FFD9D9D9');
			$objPHPExcel->getActiveSheet()->getStyle('a2:e2')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:e2')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:e2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:e2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('b2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('c2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('d2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('e2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			//$objPHPExcel->getActiveSheet()->getStyle('f2:f3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:e2')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:e2')->getFont()->setSize(10);
			$objPHPExcel->getActiveSheet()->getStyle('a2:e2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a2:e2')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a2:e2')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('a2:e2')->getFont()->setName('宋体');
		
		
			$objPHPExcel->getActiveSheet()->getColumnDimension('a')->setWidth(6);
			$objPHPExcel->getActiveSheet()->getColumnDimension('b')->setWidth(22);
			$objPHPExcel->getActiveSheet()->getColumnDimension('c')->setWidth(9);
			$objPHPExcel->getActiveSheet()->getColumnDimension('d')->setWidth(11);
			$objPHPExcel->getActiveSheet()->getColumnDimension('e')->setWidth(55);
			//$objPHPExcel->getActiveSheet()->getColumnDimension('f')->setWidth(17);
			
			$objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(40);
			$objPHPExcel->getActiveSheet()->getRowDimension('2')->setRowHeight(15);
			//$objPHPExcel->getActiveSheet()->getRowDimension('3')->setRowHeight(20);
			$objPHPExcel->getActiveSheet()->getStyle('a3:e3')->getAlignment()->setWrapText(true);
			$objPHPExcel->getActiveSheet()->getStyle('a3:e3')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
			
			//$objPHPExcel->getActiveSheet()->getStyle('a3:e3')->getFill()->getStartColor()->setARGB('FFD9D9D9');
			$objPHPExcel->getActiveSheet()->getStyle('a3:e3')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:e3')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:e3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:e3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('b3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('c3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('d3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('e3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			//$objPHPExcel->getActiveSheet()->getStyle('f2:f3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:e3')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:e3')->getFont()->setSize(10);
			$objPHPExcel->getActiveSheet()->getStyle('a3:e3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a3:e3')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			//$objPHPExcel->getActiveSheet()->getStyle('a3:e3')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('a3:e3')->getFont()->setName('宋体');
			$index=0;
			if($rows) {
			foreach($rows as $index=>$row) { 
				$objPHPExcel->setActiveSheetIndex(0)
						->setCellValue('a'.($index+3), $index+1)
						->setCellValue('b'.($index+3), $row['item12'])
						->setCellValue('c'.($index+3), $row['item6'])
						->setCellValue('d'.($index+3), $row['item9'])
						->setCellValue('e'.($index+3), $row['item3']);
						//->setCellValue('f'.($index+4), $content[$index]['bf_remark']);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':e'.($index+3))->getAlignment()->setWrapText(true);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':e'.($index+3))->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
				
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':e'.($index+3))->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':e'.($index+3))->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':e'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('b'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('c'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('d'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('e'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				//$objPHPExcel->getActiveSheet()->getStyle('f'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':e'.($index+3))->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':e'.($index+3))->getFont()->setSize(10);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':e'.($index+3))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':e'.($index+3))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':e'.($index+3))->getFont()->setName('宋体');
				$index++;
			
			}
			}
		}
		
		if($sheetIndex==1) {
		$rows=$tmp[1];
			
			$msgWorkSheet = new PHPExcel_Worksheet($objPHPExcel, '科贷公司'); 
			$objPHPExcel->addSheet($msgWorkSheet);
			$objPHPExcel->setActiveSheetIndex(1);
			$objPHPExcel->getActiveSheet()->mergeCells('a1:g1');
			$objPHPExcel->setActiveSheetIndex(1)
				->setCellValue('a1', '宿迁市高新区科技小额贷款有限公司')
				->setCellValue('a2', '序号')
				->setCellValue('b2', '企业名称')
				->setCellValue('c2', '主营业务')
				->setCellValue('d2', '贷款金额（万元）')
				->setCellValue('e2', '起始时间')
				->setCellValue('f2', '到期日')
				->setCellValue('g2', '担保方式');
	
			$objPHPExcel->getActiveSheet()->getStyle('a1:g1')->getFont()->setSize(12);
			$objPHPExcel->getActiveSheet()->getStyle('a1:g1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a1:g1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			//$objPHPExcel->getActiveSheet()->getStyle('a1:e1')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('a1:g1')->getFont()->setName('宋体');
		
		
			$objPHPExcel->getActiveSheet()->getStyle('a2:g2')->getAlignment()->setWrapText(true);
			$objPHPExcel->getActiveSheet()->getStyle('a2:g2')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
			
			$objPHPExcel->getActiveSheet()->getStyle('a2:g2')->getFill()->getStartColor()->setARGB('FFD9D9D9');
			$objPHPExcel->getActiveSheet()->getStyle('a2:g2')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:g2')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:g2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:g2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('b2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('c2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('d2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('e2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('f2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('g2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			//$objPHPExcel->getActiveSheet()->getStyle('f2:f3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:g2')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:g2')->getFont()->setSize(10);
			$objPHPExcel->getActiveSheet()->getStyle('a2:g2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a2:g2')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a2:g2')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('a2:g2')->getFont()->setName('宋体');
		
		
			$objPHPExcel->getActiveSheet()->getColumnDimension('a')->setWidth(6);
			$objPHPExcel->getActiveSheet()->getColumnDimension('b')->setWidth(24);
			$objPHPExcel->getActiveSheet()->getColumnDimension('c')->setWidth(23);
			$objPHPExcel->getActiveSheet()->getColumnDimension('d')->setWidth(8);
			$objPHPExcel->getActiveSheet()->getColumnDimension('e')->setWidth(10);
			$objPHPExcel->getActiveSheet()->getColumnDimension('f')->setWidth(10);
			$objPHPExcel->getActiveSheet()->getColumnDimension('g')->setWidth(30);
			//$objPHPExcel->getActiveSheet()->getColumnDimension('f')->setWidth(17);
			
			$objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(40);
			$objPHPExcel->getActiveSheet()->getRowDimension('2')->setRowHeight(15);
			//$objPHPExcel->getActiveSheet()->getRowDimension('3')->setRowHeight(20);
			$objPHPExcel->getActiveSheet()->getStyle('a3:g3')->getAlignment()->setWrapText(true);
			$objPHPExcel->getActiveSheet()->getStyle('a3:g3')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
			
			//$objPHPExcel->getActiveSheet()->getStyle('a3:g3')->getFill()->getStartColor()->setARGB('FFD9D9D9');
			$objPHPExcel->getActiveSheet()->getStyle('a3:g3')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:g3')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:g3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:g3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('b3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('c3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('d3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('e3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('f3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('g3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			//$objPHPExcel->getActiveSheet()->getStyle('f2:f3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:g3')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:g3')->getFont()->setSize(10);
			$objPHPExcel->getActiveSheet()->getStyle('a3:g3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a3:g3')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			//$objPHPExcel->getActiveSheet()->getStyle('a3:g3')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('a3:g3')->getFont()->setName('宋体');
			
			$index=0;
			if($rows) {
			foreach($rows as $index=>$row)  {
				$objPHPExcel->setActiveSheetIndex(1)
						->setCellValue('a'.($index+3), $index+1)
						->setCellValue('b'.($index+3), $row['item12'])
						->setCellValue('c'.($index+3), $row['item5'])
						->setCellValue('d'.($index+3), $row['item6'])
						->setCellValue('e'.($index+3), $row['item9'])
						->setCellValue('f'.($index+3), $row['item10'])
						->setCellValue('g'.($index+3), $row['item3']);
						//->setCellValue('f'.($index+4), $content[$index]['bf_remark']);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':g'.($index+3))->getAlignment()->setWrapText(true);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':g'.($index+3))->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
				
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':g'.($index+3))->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':g'.($index+3))->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':g'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('b'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('c'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('d'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('e'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('f'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('g'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				//$objPHPExcel->getActiveSheet()->getStyle('f'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':g'.($index+3))->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':g'.($index+3))->getFont()->setSize(10);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':g'.($index+3))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':g'.($index+3))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':g'.($index+3))->getFont()->setName('宋体');
				$index++;
			
			}
			}
		}
			if($sheetIndex==2) {
			$rows=$tmp[2];
				
				$msgWorkSheet = new PHPExcel_Worksheet($objPHPExcel, '监管公司'); 
				$objPHPExcel->addSheet($msgWorkSheet);
				$objPHPExcel->setActiveSheetIndex(2);
				$objPHPExcel->getActiveSheet()->mergeCells('a1:k1');
				$objPHPExcel->setActiveSheetIndex(2)
				->setCellValue('a1', '宿迁新银通资产监管有限公司')
				->setCellValue('a2', '序号')
				->setCellValue('b2', '企业')
				->setCellValue('c2', '合作类型')
				->setCellValue('d2', '放款银行')
				->setCellValue('e2', '监管物品')
				->setCellValue('f2', '贷款金额')
				->setCellValue('g2', '最低下限')
				->setCellValue('h2', '折率')
				->setCellValue('i2', '起始时间')
				->setCellValue('j2', '到期日')
				->setCellValue('k2', '监管期限（月）');
	
			$objPHPExcel->getActiveSheet()->getStyle('a1:k1')->getFont()->setSize(12);
			$objPHPExcel->getActiveSheet()->getStyle('a1:k1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a1:k1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			//$objPHPExcel->getActiveSheet()->getStyle('a1:e1')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('a1:k1')->getFont()->setName('宋体');
		
		
			$objPHPExcel->getActiveSheet()->getStyle('a2:k2')->getAlignment()->setWrapText(true);
			$objPHPExcel->getActiveSheet()->getStyle('a2:k2')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
			
			$objPHPExcel->getActiveSheet()->getStyle('a2:k2')->getFill()->getStartColor()->setARGB('FFD9D9D9');
			$objPHPExcel->getActiveSheet()->getStyle('a2:k2')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:k2')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:k2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:k2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('b2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('c2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('d2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('e2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('f2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('g2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('h2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('i2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('j2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('k2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			//$objPHPExcel->getActiveSheet()->getStyle('f2:f3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:k2')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:k2')->getFont()->setSize(10);
			$objPHPExcel->getActiveSheet()->getStyle('a2:k2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a2:k2')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a2:k2')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('a2:k2')->getFont()->setName('宋体');
		
		
			$objPHPExcel->getActiveSheet()->getColumnDimension('a')->setWidth(6);
			$objPHPExcel->getActiveSheet()->getColumnDimension('b')->setWidth(30);
			$objPHPExcel->getActiveSheet()->getColumnDimension('c')->setWidth(8);
			$objPHPExcel->getActiveSheet()->getColumnDimension('d')->setWidth(8);
			$objPHPExcel->getActiveSheet()->getColumnDimension('e')->setWidth(13);
			$objPHPExcel->getActiveSheet()->getColumnDimension('f')->setWidth(8);
			$objPHPExcel->getActiveSheet()->getColumnDimension('g')->setWidth(8);
			$objPHPExcel->getActiveSheet()->getColumnDimension('h')->setWidth(7);
			$objPHPExcel->getActiveSheet()->getColumnDimension('i')->setWidth(8);
			$objPHPExcel->getActiveSheet()->getColumnDimension('j')->setWidth(8);
			$objPHPExcel->getActiveSheet()->getColumnDimension('k')->setWidth(9);
			//$objPHPExcel->getActiveSheet()->getColumnDimension('f')->setWidth(17);
			
			$objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(40);
			$objPHPExcel->getActiveSheet()->getRowDimension('2')->setRowHeight(15);
			//$objPHPExcel->getActiveSheet()->getRowDimension('3')->setRowHeight(20);
			$objPHPExcel->getActiveSheet()->getStyle('a3:k3')->getAlignment()->setWrapText(true);
			$objPHPExcel->getActiveSheet()->getStyle('a3:k3')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
			
			//$objPHPExcel->getActiveSheet()->getStyle('a3:k3')->getFill()->getStartColor()->setARGB('FFD9D9D9');
			$objPHPExcel->getActiveSheet()->getStyle('a3:k3')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:k3')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:k3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:k3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('b3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('c3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('d3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('e3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('f3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('g3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('h3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('i3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('j3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('k3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			//$objPHPExcel->getActiveSheet()->getStyle('f2:f3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:k3')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:k3')->getFont()->setSize(10);
			$objPHPExcel->getActiveSheet()->getStyle('a3:k3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a3:k3')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			//$objPHPExcel->getActiveSheet()->getStyle('a3:k3')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('a3:k3')->getFont()->setName('宋体');
			
			$index=0;
			if($rows) {
			foreach($rows as $index=>$row)  {
				$objPHPExcel->setActiveSheetIndex(2)
						->setCellValue('a'.($index+3), $index+1)
						->setCellValue('b'.($index+3), $row['item12'])
						->setCellValue('c'.($index+3), $row['item3'])
						->setCellValue('d'.($index+3), $row['item4'])
						->setCellValue('e'.($index+3), $row['item5'])
						->setCellValue('f'.($index+3), $row['item6'])
						->setCellValue('g'.($index+3), $row['item7'])
						->setCellValue('h'.($index+3), $row['item8'])
						->setCellValue('i'.($index+3), $row['item9'])
						->setCellValue('j'.($index+3), $row['item10'])
						->setCellValue('k'.($index+3), $row['item11']);
						//->setCellValue('k'.($index+3), $content[$index]['ad_company_lower_bound']);
						//->setCellValue('f'.($index+4), $content[$index]['bf_remark']);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':k'.($index+3))->getAlignment()->setWrapText(true);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':k'.($index+3))->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
				
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':k'.($index+3))->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':k'.($index+3))->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':k'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('b'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('c'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('d'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('e'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('f'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('g'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('h'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('i'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('j'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('k'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				//$objPHPExcel->getActiveSheet()->getStyle('f'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':k'.($index+3))->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':k'.($index+3))->getFont()->setSize(10);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':k'.($index+3))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':k'.($index+3))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':k'.($index+3))->getFont()->setName('宋体');
				$index++;
			
			}
			}
		}
		if($sheetIndex==3) {
		$rows=$tmp[3];
			
				$msgWorkSheet = new PHPExcel_Worksheet($objPHPExcel, '农贷公司'); 
				$objPHPExcel->addSheet($msgWorkSheet);
				$objPHPExcel->setActiveSheetIndex(3);
				$objPHPExcel->getActiveSheet()->mergeCells('a1:i1');
				$objPHPExcel->setActiveSheetIndex(3)
				->setCellValue('a1', '宿城区同济农村小额贷款有限公司')
				->setCellValue('a2', '序号')
				->setCellValue('b2', '企业')
				->setCellValue('c2', '担保方式')
				->setCellValue('d2', '担保情况')
				->setCellValue('e2', '贷款金额')
				->setCellValue('f2', '系统利率')
				->setCellValue('g2', '起始时间')
				->setCellValue('h2', '到期日')
				->setCellValue('i2', '实际用款人');
			$objPHPExcel->getActiveSheet()->getStyle('a1:i1')->getFont()->setSize(12);
			$objPHPExcel->getActiveSheet()->getStyle('a1:i1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a1:i1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			//$objPHPExcel->getActiveSheet()->getStyle('a1:e1')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('a1:i1')->getFont()->setName('宋体');
		
		
			$objPHPExcel->getActiveSheet()->getStyle('a2:i2')->getAlignment()->setWrapText(true);
			$objPHPExcel->getActiveSheet()->getStyle('a2:i2')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
			
			$objPHPExcel->getActiveSheet()->getStyle('a2:i2')->getFill()->getStartColor()->setARGB('FFD9D9D9');
			$objPHPExcel->getActiveSheet()->getStyle('a2:i2')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:i2')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:i2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:i2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('b2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('c2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('d2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('e2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('f2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('g2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('h2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('i2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			//$objPHPExcel->getActiveSheet()->getStyle('j2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			//$objPHPExcel->getActiveSheet()->getStyle('k2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			//$objPHPExcel->getActiveSheet()->getStyle('f2:f3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:i2')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:i2')->getFont()->setSize(10);
			$objPHPExcel->getActiveSheet()->getStyle('a2:i2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a2:i2')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a2:i2')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('a2:i2')->getFont()->setName('宋体');
		
		
			$objPHPExcel->getActiveSheet()->getColumnDimension('a')->setWidth(6);
			$objPHPExcel->getActiveSheet()->getColumnDimension('b')->setWidth(25);
			$objPHPExcel->getActiveSheet()->getColumnDimension('c')->setWidth(8);
			$objPHPExcel->getActiveSheet()->getColumnDimension('d')->setWidth(14);
			$objPHPExcel->getActiveSheet()->getColumnDimension('e')->setWidth(8);
			$objPHPExcel->getActiveSheet()->getColumnDimension('f')->setWidth(8);
			$objPHPExcel->getActiveSheet()->getColumnDimension('g')->setWidth(11);
			$objPHPExcel->getActiveSheet()->getColumnDimension('h')->setWidth(11);
			$objPHPExcel->getActiveSheet()->getColumnDimension('i')->setWidth(10);
			//$objPHPExcel->getActiveSheet()->getColumnDimension('j')->setWidth(8);
			//$objPHPExcel->getActiveSheet()->getColumnDimension('k')->setWidth(9);
			//$objPHPExcel->getActiveSheet()->getColumnDimension('f')->setWidth(17);
			
			$objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(40);
			$objPHPExcel->getActiveSheet()->getRowDimension('2')->setRowHeight(15);
			//$objPHPExcel->getActiveSheet()->getRowDimension('3')->setRowHeight(20);
			$objPHPExcel->getActiveSheet()->getStyle('a3:i3')->getAlignment()->setWrapText(true);
			$objPHPExcel->getActiveSheet()->getStyle('a3:i3')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
			
			//$objPHPExcel->getActiveSheet()->getStyle('a3:i3')->getFill()->getStartColor()->setARGB('FFD9D9D9');
			$objPHPExcel->getActiveSheet()->getStyle('a3:i3')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:i3')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:i3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:i3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('b3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('c3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('d3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('e3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('f3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('g3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('h3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('i3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			//$objPHPExcel->getActiveSheet()->getStyle('j2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			//$objPHPExcel->getActiveSheet()->getStyle('k2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			//$objPHPExcel->getActiveSheet()->getStyle('f2:f3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:i3')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a3:i3')->getFont()->setSize(10);
			$objPHPExcel->getActiveSheet()->getStyle('a3:i3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a3:i3')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			//$objPHPExcel->getActiveSheet()->getStyle('a3:i3')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('a3:i3')->getFont()->setName('宋体');
			
			$index=0;
			if($rows) {
			foreach($rows as $index=>$row) { 
				$objPHPExcel->setActiveSheetIndex(3)
						->setCellValue('a'.($index+3), $index+1)
						->setCellValue('b'.($index+3), $row['item12'])
						->setCellValue('c'.($index+3), $row['item3'])
						->setCellValue('d'.($index+3), $row['item4'])
						->setCellValue('e'.($index+3), $row['item6'])
						->setCellValue('f'.($index+3), $row['item8'])
						->setCellValue('g'.($index+3), $row['item9'])
						->setCellValue('h'.($index+3), $row['item10'])
						->setCellValue('i'.($index+3), $row['item5']);
						//->setCellValue('j'.($index+3), $content[$index]['ad_company_end_time'])
						//->setCellValue('k'.($index+3), $content[$index]['ad_company_time']);
						//->setCellValue('k'.($index+3), $content[$index]['ad_company_lower_bound']);
						//->setCellValue('f'.($index+4), $content[$index]['bf_remark']);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':i'.($index+3))->getAlignment()->setWrapText(true);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':i'.($index+3))->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
				
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':i'.($index+3))->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':i'.($index+3))->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':i'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('b'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('c'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('d'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('e'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('f'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('g'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('h'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('i'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				//$objPHPExcel->getActiveSheet()->getStyle('j'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				//$objPHPExcel->getActiveSheet()->getStyle('k'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				//$objPHPExcel->getActiveSheet()->getStyle('f'.($index+3))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':i'.($index+3))->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':i'.($index+3))->getFont()->setSize(10);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':i'.($index+3))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':i'.($index+3))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('a'.($index+3).':i'.($index+3))->getFont()->setName('宋体');
				$index++;
			
			}
			}
		}
		
		$sheetIndex++;
	}

}


if($the_module=='BadInfo' or $the_module=='badinfo') {
	$objPHPExcel = new PHPExcel();

		$objPHPExcel->getActiveSheet()->setTitle('客户不良信息通报');
	$objPHPExcel->getProperties()->setCreator("")
		->setLastModifiedBy("")
							 ->setTitle("")
							 ->setSubject("")
							 ->setDescription("")
							 ->setKeywords("")
							 ->setCategory("");
				
	$objPHPExcel->getActiveSheet()->mergeCells('a1:f1');
	$objPHPExcel->getActiveSheet()->mergeCells('a2:a3');
	$objPHPExcel->getActiveSheet()->mergeCells('b2:b3');
	$objPHPExcel->getActiveSheet()->mergeCells('c2:c3');
	$objPHPExcel->getActiveSheet()->mergeCells('d2:d3');
	$objPHPExcel->getActiveSheet()->mergeCells('e2:e3');
	$objPHPExcel->getActiveSheet()->mergeCells('f2:f3');
	
		$objPHPExcel->setActiveSheetIndex(0)
					->setCellValue('a1', '宿迁产业发展集团业务不良信息登记表')
					->setCellValue('a2', '序号')
					->setCellValue('b2', '企业/个人名称')
					->setCellValue('c2', '业务类型')
					->setCellValue('d2', '不良信息摘录')
					->setCellValue('e2', '业务建议')
					->setCellValue('f2', '备注');
	
			$objPHPExcel->getActiveSheet()->getStyle('a1:f1')->getFont()->setSize(18);
			$objPHPExcel->getActiveSheet()->getStyle('a1:f1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a1:f1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a1:f1')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('a1:f1')->getFont()->setName('宋体');
		
			$objPHPExcel->getActiveSheet()->getStyle('a2:f3')->getAlignment()->setWrapText(true);
			$objPHPExcel->getActiveSheet()->getStyle('a2:f3')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
			
			$objPHPExcel->getActiveSheet()->getStyle('a2:f3')->getFill()->getStartColor()->setARGB('FFD9D9D9');
			$objPHPExcel->getActiveSheet()->getStyle('a2:f3')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:f3')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:f3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:a3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('b2:b3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('c2:c3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('d2:d3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('e2:e3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('f2:f3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:f3')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a2:f3')->getFont()->setSize(14);
			$objPHPExcel->getActiveSheet()->getStyle('a2:f3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a2:f3')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a2:f3')->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('a2:f3')->getFont()->setName('宋体');
		
		
		$objPHPExcel->getActiveSheet()->getColumnDimension('a')->setWidth(8);
		$objPHPExcel->getActiveSheet()->getColumnDimension('b')->setWidth(23);
		$objPHPExcel->getActiveSheet()->getColumnDimension('c')->setWidth(15);
		$objPHPExcel->getActiveSheet()->getColumnDimension('d')->setWidth(35);
		$objPHPExcel->getActiveSheet()->getColumnDimension('e')->setWidth(27);
		$objPHPExcel->getActiveSheet()->getColumnDimension('f')->setWidth(17);
		
		$objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(50);
		$objPHPExcel->getActiveSheet()->getRowDimension('2')->setRowHeight(20);
		$objPHPExcel->getActiveSheet()->getRowDimension('3')->setRowHeight(20);
		
		$index=0;
		while($index<count($content)) {
			$objPHPExcel->setActiveSheetIndex(0)
					->setCellValue('a'.($index+4), $index+1)
					->setCellValue('b'.($index+4), $content[$index]['bf_company_name'])
					->setCellValue('c'.($index+4), $content[$index]['bf_business_type'])
					->setCellValue('d'.($index+4), $content[$index]['bf_digest'])
					->setCellValue('e'.($index+4), $content[$index]['bf_advice'])
					->setCellValue('f'.($index+4), $content[$index]['bf_remark']);
			$index++;
		
		}
		$blank = 4;
		while($blank<18) {
		$objPHPExcel->setActiveSheetIndex(0);
	$objActSheet = $objPHPExcel->getActiveSheet();
	$objValidation=$objActSheet->getCell('c'.$blank)->getDataValidation(); 
	$objValidation  -> setType(PHPExcel_Cell_DataValidation::TYPE_LIST)
	       -> setErrorStyle(PHPExcel_Cell_DataValidation::STYLE_INFORMATION)
	       -> setAllowBlank(false)
	       -> setShowInputMessage(true)
	       -> setShowErrorMessage(true)
	       -> setShowDropDown(true)
	       -> setErrorTitle('输入的值有误')
	       -> setError('您输入的值不在下拉框列表内.')
	       -> setPromptTitle('业务类型')
	       -> setFormula1('"担保业务,农贷业务,科贷业务,监管业务,投资业务,反担保业务,其他"');
			$objPHPExcel->getActiveSheet()->getStyle('a'.$blank.':f'.$blank)->getAlignment()->setWrapText(true);
			$objPHPExcel->getActiveSheet()->getStyle('a'.$blank.':f'.$blank)->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
			
			$objPHPExcel->getActiveSheet()->getStyle('a'.$blank.':f'.$blank)->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a'.$blank.':f'.$blank)->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a'.$blank.':f'.$blank)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a'.$blank)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('b'.$blank)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('c'.$blank)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('d'.$blank)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('e'.$blank)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('f'.$blank)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a'.$blank.':f'.$blank)->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
			$objPHPExcel->getActiveSheet()->getStyle('a'.$blank.':f'.$blank)->getFont()->setSize(14);
			$objPHPExcel->getActiveSheet()->getStyle('a'.$blank.':f'.$blank)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a'.$blank.':f'.$blank)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a'.$blank.':f'.$blank)->getFont()->setName('宋体');
			
			$blank++;
	}	
	
	while($index<count($content)) {
			$objPHPExcel->setActiveSheetIndex(0)
					->setCellValue('c'.($index+4), $content[$index]['bf_business_type']);
			$index++;
		
		}
}

if($the_module=='Invested' or $the_module=='invested' or $the_module=='Candidates' or $the_module=='candidates' or 
	$the_module=='Localkey' or $the_module=='localkey' or $the_module=='Leaders' or $the_module=='leaders') {

	$tmp=array();
	$tmp[0]=array();
	$ivIndex=0;$cdIndex=0;$ldIndex=0;$lkIndex=0;
	$index=0;
	//var_dump(count($content));
	while($index<count($content)) {

		if($content[$index]['company_properties']=='1') {
		//var_dump("im here0");
			$tmp[0][$ivIndex] = $content[$index];
			$index++;
			$ivIndex++;
		}
		else if($content[$index]['company_properties']=='2') {
		//var_dump("im here1");
			$tmp[1][$cdIndex] = $content[$index];
			$index++;
			$cdIndex++;
		}
		else if($content[$index]['company_properties']=='3') {
		//var_dump("im here2");
			$tmp[2][$ldIndex] = $content[$index];
			$index++;
			$ldIndex++;
		}
		else if($content[$index]['company_properties']=='4') {
		//var_dump("im here3");
			$tmp[3][$lkIndex] = $content[$index];
			$index++;
			$lkIndex++;
		}
		else {
		//var_dump("im here4");
			$index++;
		}
	}

	$objPHPExcel = new PHPExcel();

		$proType=0;	
		//var_dump(count($tmp));
	while($proType < count($tmp)) {
			//var_dump($proType);
			$rows = $tmp[$proType];
		//foreach($tmp as $proType=>$rows) {
			//var_dump($proType);
			if($proType==0) {
			 
				$objPHPExcel->getActiveSheet()->setTitle('已投企业');
				$objPHPExcel->getProperties()->setCreator("")
								 ->setLastModifiedBy("")
								 ->setTitle("")
								 ->setSubject("")
								 ->setDescription("")
								 ->setKeywords("")
								 ->setCategory("");
			}
			
			if($proType==1) {
				$msgWorkSheet = new PHPExcel_Worksheet($objPHPExcel, '拟投企业'); 
				$objPHPExcel->addSheet($msgWorkSheet);
				$objPHPExcel->setActiveSheetIndex($proType);
			}
			
			if($proType==2) {
				$msgWorkSheet = new PHPExcel_Worksheet($objPHPExcel, '行业龙头'); 
				$objPHPExcel->addSheet($msgWorkSheet);
				$objPHPExcel->setActiveSheetIndex($proType);
			}
			//var_dump($proType);
			if($proType==3) {
			
				$msgWorkSheet = new PHPExcel_Worksheet($objPHPExcel, '地方重点'); 
				
				$objPHPExcel->addSheet($msgWorkSheet);
				
				$objPHPExcel->setActiveSheetIndex($proType);
				//var_dump($proType);
			}
			
			
			if($proType==0 or $proType==2)		
				$objPHPExcel->getActiveSheet()->mergeCells('b1:n1');
			if($proType==1 or $proType==3)		
				$objPHPExcel->getActiveSheet()->mergeCells('b1:m1');
			//var_dump($proType);
			$objPHPExcel->setActiveSheetIndex($proType)
						->setCellValue('b1', '宿迁产业发展集团有限公司项目库企业信息表')
						->setCellValue('b2', '序号')
						->setCellValue('c2', '公司名称')
						->setCellValue('d2', '注册资本（万元）')
						->setCellValue('e2', '主要产品');
			if($proType==0 or $proType==1 or $proType==3) {
				$objPHPExcel->setActiveSheetIndex($proType)
						->setCellValue('f2', '销售收入（万元）')
						->setCellValue('g2', '利润总额（万元）')
						->setCellValue('h2', '利润率（%）')
						->setCellValue('i2', '公司简介')
						->setCellValue('j2', '公司地址')
						->setCellValue('k2', '联系人')
						->setCellValue('l2', '联系方式')
						->setCellValue('m2', '授信总额');
						
			}	
			if($proType==0) 
				$objPHPExcel->setActiveSheetIndex($proType)->setCellValue('n2', '投资主体');
			
			if($proType==2) {
				$objPHPExcel->setActiveSheetIndex($proType)
						->setCellValue('f2', '所属行业')
						->setCellValue('g2', '销售收入（万元）')
						->setCellValue('h2', '利润总额（万元）')
						->setCellValue('i2', '利润率（%）')
						->setCellValue('j2', '公司简介')
						->setCellValue('k2', '公司地址')
						->setCellValue('l2', '联系人')
						->setCellValue('m2', '联系方式')
						->setCellValue('n2', '授信总额');
						
			}	
			if($proType==0 or $proType==2) {
				$objPHPExcel->getActiveSheet()->getStyle('b1:n1')->getFont()->setSize(18);
				$objPHPExcel->getActiveSheet()->getStyle('b1:n1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('b1:n1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('b1:n1')->getFont()->setBold(true);
				$objPHPExcel->getActiveSheet()->getStyle('b1:n1')->getFont()->setName('宋体');
			
				$objPHPExcel->getActiveSheet()->getStyle('b2:n2')->getAlignment()->setWrapText(true);
				$objPHPExcel->getActiveSheet()->getStyle('b2:n2')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
				
				$objPHPExcel->getActiveSheet()->getStyle('b2:n2')->getFill()->getStartColor()->setARGB('FFD9D9D9');
				$objPHPExcel->getActiveSheet()->getStyle('b2:n2')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('b2:n2')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('b2:n2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('c2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('d2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('e2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('f2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('g2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('h2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('i2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('j2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('k2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('l2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('m2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('n2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('b2:n2')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('b2:n2')->getFont()->setSize(10);
				$objPHPExcel->getActiveSheet()->getStyle('b2:n2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('b2:n2')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('b2:n2')->getFont()->setBold(true);
				$objPHPExcel->getActiveSheet()->getStyle('b2:n2')->getFont()->setName('宋体');
			}
			
			if($proType==1 or $proType==3) {
				$objPHPExcel->getActiveSheet()->getStyle('b1:m1')->getFont()->setSize(18);
				$objPHPExcel->getActiveSheet()->getStyle('b1:m1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('b1:m1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('b1:m1')->getFont()->setBold(true);
				$objPHPExcel->getActiveSheet()->getStyle('b1:m1')->getFont()->setName('宋体');
			
				$objPHPExcel->getActiveSheet()->getStyle('b2:m2')->getAlignment()->setWrapText(true);
				$objPHPExcel->getActiveSheet()->getStyle('b2:m2')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
				
				$objPHPExcel->getActiveSheet()->getStyle('b2:m2')->getFill()->getStartColor()->setARGB('FFD9D9D9');
				$objPHPExcel->getActiveSheet()->getStyle('b2:m2')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('b2:m2')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('b2:m2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('c2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('d2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('e2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('f2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('g2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('h2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('i2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('j2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('k2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('l2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('m2')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('b2:m2')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
				$objPHPExcel->getActiveSheet()->getStyle('b2:m2')->getFont()->setSize(10);
				$objPHPExcel->getActiveSheet()->getStyle('b2:m2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('b2:m2')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle('b2:m2')->getFont()->setBold(true);
				$objPHPExcel->getActiveSheet()->getStyle('b2:m2')->getFont()->setName('宋体');
			}
			
			$objPHPExcel->getActiveSheet()->getColumnDimension('b')->setWidth(5);
			$objPHPExcel->getActiveSheet()->getColumnDimension('c')->setWidth(10);
			$objPHPExcel->getActiveSheet()->getColumnDimension('d')->setWidth(10);
			$objPHPExcel->getActiveSheet()->getColumnDimension('e')->setWidth(15);
			$objPHPExcel->getActiveSheet()->getColumnDimension('f')->setWidth(10);
			$objPHPExcel->getActiveSheet()->getColumnDimension('g')->setWidth(10);
			if($proType==0 or $proType==1 or $proType==3) {
				$objPHPExcel->getActiveSheet()->getColumnDimension('h')->setWidth(8);
				$objPHPExcel->getActiveSheet()->getColumnDimension('i')->setWidth(27);
				$objPHPExcel->getActiveSheet()->getColumnDimension('j')->setWidth(12);
				$objPHPExcel->getActiveSheet()->getColumnDimension('k')->setWidth(8);
				$objPHPExcel->getActiveSheet()->getColumnDimension('l')->setWidth(20);
				$objPHPExcel->getActiveSheet()->getColumnDimension('m')->setWidth(10);
			}
			if($proType==0 or $proType==2)
				$objPHPExcel->getActiveSheet()->getColumnDimension('n')->setWidth(10);
				
			if($proType==2) {
				$objPHPExcel->getActiveSheet()->getColumnDimension('h')->setWidth(10);
				$objPHPExcel->getActiveSheet()->getColumnDimension('i')->setWidth(8);
				$objPHPExcel->getActiveSheet()->getColumnDimension('j')->setWidth(27);
				$objPHPExcel->getActiveSheet()->getColumnDimension('k')->setWidth(12);
				$objPHPExcel->getActiveSheet()->getColumnDimension('l')->setWidth(8);
				$objPHPExcel->getActiveSheet()->getColumnDimension('m')->setWidth(20);	
			}
			$objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(50);
			$objPHPExcel->getActiveSheet()->getRowDimension('2')->setRowHeight(30);
			//var_dump($proType);
			$line='3';
			$currentLine='3';
			foreach($rows as $index=>$row) {
				$currentLine = $line+$index;
				
				$objPHPExcel->setActiveSheetIndex($proType)
						->setCellValue('b'.$currentLine, $index+1)
						->setCellValue('c'.$currentLine, $row['company_name'])
						->setCellValue('d'.$currentLine, $row['company_registed_capital'])
						->setCellValue('e'.$currentLine, $row['main_products']);
				if($proType==0 or $proType==1 or $proType==3) {
					$objPHPExcel->setActiveSheetIndex($proType)
						->setCellValue('f'.$currentLine, $row['company_sales'])
						->setCellValue('g'.$currentLine, $row['company_profit'])
						->setCellValue('h'.$currentLine, $row['company_profit_rate'])
						->setCellValue('i'.$currentLine, $row['company_profile'])
						->setCellValue('j'.$currentLine, $row['company_address'])
						->setCellValue('k'.$currentLine, $row['company_contact_name'])
						->setCellValue('l'.$currentLine, $row['company_mobile_phone'])
						->setCellValue('m'.$currentLine, $row['company_total_loan']);
				}
				if($proType==0) 
					$objPHPExcel->setActiveSheetIndex($proType)->setCellValue('n'.$currentLine, $row['company_investment_subject']);
				if($proType==2) {
					$objPHPExcel->setActiveSheetIndex($proType)
						->setCellValue('f'.$currentLine, $row['company_industry'])
						->setCellValue('g'.$currentLine, $row['company_sales'])
						->setCellValue('h'.$currentLine, $row['company_profit'])
						->setCellValue('i'.$currentLine, $row['company_profit_rate'])
						->setCellValue('j'.$currentLine, $row['company_profile'])
						->setCellValue('k'.$currentLine, $row['company_address'])
						->setCellValue('l'.$currentLine, $row['company_contact_name'])
						->setCellValue('m'.$currentLine, $row['company_mobile_phone'])
						->setCellValue('n'.$currentLine, $row['company_total_loan']);
				}
				
				if($proType==0 or $proType==2) {		
					$objPHPExcel->getActiveSheet()->getRowDimension($currentLine)->setRowHeight(120);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':n'.$currentLine)->getAlignment()->setWrapText(true);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':n'.$currentLine)->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
					if($row['company_info_collected']=='1' or $row['company_info_collected']==1)
						$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':n'.$currentLine)->getFill()->getStartColor()->setARGB('FFda9694');
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':n'.$currentLine)->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':n'.$currentLine)->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':n'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('c'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('d'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('e'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('f'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('g'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('h'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('i'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('j'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('k'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('l'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('m'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('n'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':n'.$currentLine)->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':n'.$currentLine)->getFont()->setSize(10);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':n'.$currentLine)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':n'.$currentLine)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':n'.$currentLine)->getFont()->setName('宋体');
				}	
				if($proType==1 or $proType==3) {		
					$objPHPExcel->getActiveSheet()->getRowDimension($currentLine)->setRowHeight(120);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':m'.$currentLine)->getAlignment()->setWrapText(true);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':m'.$currentLine)->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
					if($row['company_info_collected']=='1' or $row['company_info_collected']==1)
						$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':m'.$currentLine)->getFill()->getStartColor()->setARGB('FFda9694');
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':m'.$currentLine)->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':m'.$currentLine)->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':m'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('c'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('d'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('e'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('f'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('g'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('h'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('i'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('j'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('k'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('l'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('m'.$currentLine)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':m'.$currentLine)->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':m'.$currentLine)->getFont()->setSize(10);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':m'.$currentLine)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':m'.$currentLine)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
					$objPHPExcel->getActiveSheet()->getStyle('b'.$currentLine.':m'.$currentLine)->getFont()->setName('宋体');
				}			
				
				if($row['company_is_potential']=='1' or $row['company_is_potential']==1) {
					$objPHPExcel->setActiveSheetIndex($proType)->setCellValue('a'.$currentLine, '※');
					$objPHPExcel->getActiveSheet()->getStyle('a'.$currentLine)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
					$objPHPExcel->getActiveSheet()->getStyle('a'.$currentLine)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
					$objPHPExcel->getActiveSheet()->getStyle('a'.$currentLine)->getFont()->setSize(10);
					$objPHPExcel->getActiveSheet()->getStyle('a'.$currentLine)->getFont()->setName('宋体');
				}
			}
	//var_dump($proType);
			$remark_line = $currentLine+3;
			$remark_line1 = $remark_line+1;
			$objPHPExcel->getActiveSheet()->mergeCells('d'.$remark_line.':n'.$remark_line);
			$objPHPExcel->getActiveSheet()->mergeCells('d'.$remark_line1.':f'.$remark_line1);
			
			$objPHPExcel->setActiveSheetIndex($proType)
						->setCellValue('b'.$remark_line, '注：')
						->setCellValue('c'.$remark_line, '※')
						->setCellValue('d'.$remark_line, '指已投或具有投资潜力的企业')
						->setCellValue('d'.$remark_line1, '表示信息已采集');
			
			$objPHPExcel->getActiveSheet()->getStyle('d'.$remark_line.':n'.$remark_line)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
			$objPHPExcel->getActiveSheet()->getStyle('b'.$remark_line.':n'.$remark_line)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a'.$remark_line.':c'.$remark_line)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('d'.$remark_line1.':n'.$remark_line1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
			$objPHPExcel->getActiveSheet()->getStyle('b'.$remark_line1.':n'.$remark_line1)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('a'.$remark_line1.':c'.$remark_line1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle('b'.$remark_line.':n'.$remark_line)->getFont()->setSize(10);
			$objPHPExcel->getActiveSheet()->getStyle('b'.$remark_line.':n'.$remark_line)->getFont()->setName('宋体');
			$objPHPExcel->getActiveSheet()->getStyle('b'.$remark_line1.':n'.$remark_line1)->getFont()->setSize(10);
			$objPHPExcel->getActiveSheet()->getStyle('b'.$remark_line1.':n'.$remark_line1)->getFont()->setName('宋体');
			
			$objPHPExcel->getActiveSheet()->getStyle('b'.$remark_line.':n'.$remark_line)->getFont()->setBold(true);
			$objPHPExcel->getActiveSheet()->getStyle('b'.$remark_line1.':n'.$remark_line1)->getFont()->setBold(true);
			$objPHPExcel->setActiveSheetIndex($proType);
			$objPHPExcel->getActiveSheet()->getStyle('a'.$remark_line1)->getFill()->getStartColor()->setARGB('FFda9694');
			$proType++;
			//var_dump($proType);
	}
}
$fileName = '1.xlsx';
if($the_module=='Invested' or $the_module=='invested' or $the_module=='Candidates' or $the_module=='candidates' or $the_module=='Leaders' or $the_module=='leaders' or $the_module=='Localkey' or $the_module=='localkey') {
	//var_dump($the_module);
	$fileName = '2.xlsx';
}
else if($the_module=='BadInfo' or $the_module=='badinfo')
	$fileName = '3.xlsx';
	
else if($the_module=='WarrantCompany' or $the_module=='warrantcompany' or $the_module=='SciLoanCompany' or $the_module=='sciloancompany' or $the_module=='AgriLoanCompany' or $the_module=='agriloancompany' or $the_module=='AdministerCompany' or $the_module=='administercompany')
	$fileName = '4.xlsx';	

$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
$objWriter->save($fileName); 


//$objWriter->save('Invested.xls'); 

$dir=$fileName; 
//$dir1='Invested.xls';
//$file = fopen($dir,"r"); 
//var_dump($dir);
Header("Content-type: application/octet-stream"); 
Header("Accept-Ranges: bytes"); 
Header("Content-type: application/vnd.ms-excel");
Header("Content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); 
//Header("Accept-Length: ".filesize($dir)); 
Header("Content-Disposition: attachment; filename=".$dir);
//Header("Content-Disposition: attachment; filename=".$dir1); 

echo file_get_contents($dir,1,null,0,filesize($dir));
//fclose($file); 

//exit; 
  
//application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
//if($the_module=='Invested' or $the_module=='invested')   
	//$objWriter->save('已投企业.xlsx');
	//companies.company_industry,
 
 /*
//Bug 30094, If zlib is enabled, it can break the calls to header() due to output buffering. This will only work php5.2+
ini_set('zlib.output_compression', 'Off');

ob_start();
require_once('include/export_utils.php');
global $sugar_config;
global $locale;
global $current_user;
global $app_list_strings;

$the_module = clean_string($_REQUEST['module']);

if($sugar_config['disable_export'] 	|| (!empty($sugar_config['admin_export_only']) && !(is_admin($current_user) || (ACLController::moduleSupportsACL($the_module)  && ACLAction::getUserAccessLevel($current_user->id,$the_module, 'access') == ACL_ALLOW_ENABLED &&
    (ACLAction::getUserAccessLevel($current_user->id, $the_module, 'admin') == ACL_ALLOW_ADMIN ||
     ACLAction::getUserAccessLevel($current_user->id, $the_module, 'admin') == ACL_ALLOW_ADMIN_DEV))))){
	die($GLOBALS['app_strings']['ERR_EXPORT_DISABLED']);
}
//check to see if this is a request for a sample or for a regular export
if(!empty($_REQUEST['sample'])){

    //call special method that will create dummy data for bean as well as insert standard help message.
    $content = exportSample(clean_string($_REQUEST['module']));
}else if(!empty($_REQUEST['uid'])){
	$content = export(clean_string($_REQUEST['module']), $_REQUEST['uid'], isset($_REQUEST['members']) ? $_REQUEST['members'] : false);
	
}else{
	$content = export(clean_string($_REQUEST['module']));
	
}
$filename = $_REQUEST['module'];
//use label if one is defined
if(!empty($app_list_strings['moduleList'][$_REQUEST['module']])){
    $filename = $app_list_strings['moduleList'][$_REQUEST['module']];
}

//strip away any blank spaces
$filename = str_replace(' ','',$filename);

$transContent = $GLOBALS['locale']->translateCharset($content, 'UTF-8', $GLOBALS['locale']->getExportCharset());
//var_dump($transContent);

if($_REQUEST['members'] == true)
	$filename .= '_'.'members';
///////////////////////////////////////////////////////////////////////////////
////	BUILD THE EXPORT FILE
ob_clean();
//header("Pragma: cache");
//header("Content-type: application/vnd.ms-excel; charset=".$GLOBALS['locale']->getExportCharset());
//header("Content-Disposition: attachment; filename={$filename}.csv");
//header("Content-transfer-encoding: binary");
//header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
//header("Last-Modified: " . TimeDate::httpTime() );
//header("Cache-Control: post-check=0, pre-check=0", false );
//header("Content-Length: ".mb_strlen($transContent, '8bit'));
if (!empty($sugar_config['export_excel_compatible'])) {
    $transContent=chr(255) . chr(254) . mb_convert_encoding($transContent, 'UTF-16LE', 'UTF-8');
}
var_dump($content);

sugar_cleanup(true);
*/
?>